
class Dog {
	int age;
	String color;
	String name;
	
	public void bark() {
		if(age<2) {
			System.out.println(name+":叽叽叽!");
		} else if(age<12) {
			System.out.println(name+":旺旺旺!");
		} else {
			System.out.println(name+":呜呜呜!");
		}
	}
}

public class TestDog {
	public static void main(String[] args) {
		Dog d = new Dog();//创建了一个对象d，d是Dog类型
		d.age = 16;
		d.color = "黄色";
		d.name = "旺财";
		d.bark();
	}
}
